<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/12/12
 * Time: 14:33
 */

use yii\widgets\ActiveForm;
use yii\helpers\Html;
use common\components\widgets\Datetimepicker;

Datetimepicker::widget(['timepicker' => 'true', 'format' => 'Y-m-d H:i']);
?>
<div class="yx-praise-box zx-min-height">
    <div class="yx-praise-list-box yx-praise-list-box1">
        <table width="100%" class="table-form">
            <tr>
                <th class="zx-goods-table">课程详情</th>
                <table class="yx-course-info " style="table-layout: fixed">
                    <tr>
                        <td>课程</td>
                        <td><?= Html::encode($specialdatas['course_name']) ?></td>
                        <td>教师</td>
                        <td><?= Html::encode($specialdatas['teacher_name']) ?></td>
                    </tr>
                    <tr>
                        <td>教室</td>
                        <td><?= Html::encode($specialdatas['room_name']) ?></td>
                        <td>上课星期</td>
                        <td><?= Html::encode($specialdatas['class_day']) ?></td>
                    </tr>
                    <tr>
                        <td>开班人数</td>
                        <td><?= Html::encode($specialdatas['opening_number']) ?></td>
                        <td>最满人数</td>
                        <td><?= Html::encode($specialdatas['max_number']) ?></td>
                    </tr>
                    <tr>
                        <td>是否可预约</td>
                        <td><?= Html::encode($specialdatas['is_booking'] == 1 ? '是' : '否') ?></td>
                        <td>上课次数</td>
                        <td><?= Html::encode($specialdatas['class_count']) ?></td>
                    </tr>
                </table>
                <?= $default ?>
            </tr>

            <table id="tablesaw" class="tablesaw table yx-table1 yx-table5 table-striped with-check"
                   data-tablesaw-mode="swipe" data-tablesaw-minimap>
                <thead>
                <tr class="yx-bgd2f6ec">
                    <th><?= \Yii::t('zhtfrontend', '价格名称'); ?></th>
                    <th><?= \Yii::t('zhtfrontend', '课次数'); ?></th>
                    <th><?= \Yii::t('zhtfrontend', '原价'); ?></th>
                    <th><?= \Yii::t('zhtfrontend', '价格'); ?></th>
                    <th><?= \Yii::t('zhtfrontend', '分成方式'); ?></th>
                    <th><?= \Yii::t('zhtfrontend', '分成金额/比例'); ?></th>
                    <th><?= \Yii::t('zhtfrontend', '补贴方式'); ?></th>
                    <th><?= \Yii::t('zhtfrontend', '补贴金额'); ?></th>
                    <th><?= \Yii::t('zhtfrontend', '是否支持奖学金'); ?></th>
                    <th><?= \Yii::t('zhtfrontend', '使用奖学金金额'); ?></th>
                    <th><?= \Yii::t('zhtfrontend', '状态'); ?></th>
                </tr>
                </thead>
                <?php if ($goodsprice): ?>
                    <?php foreach ($goodsprice as $item): ?>
                        <tr data-id="<?= $item['id'] ?>">
                            <td><?= $item['price_name'] ?></td>
                            <td><?= $item['lesson'] ?></td>
                            <td><?= $item['market_price'] ?></td>
                            <td><?= $item['lesson_price'] ?></td>
                            <td><?= $item['distribution_way'] ?></td>
                            <td><?= $item['distribution_proportion'] ?></td>
                            <td><?= $item['subsidy_type'] ?></td>
                            <td><?= $item['subsidy_money'] ?></td>
                            <td><?= $item['is_scholarship'] ?></td>
                            <td><?= $item['scholarship'] ?></td>
                            <td><?= $item['status'] ?></td>
                        </tr>
                    <?php endforeach ?>
                <?php endif ?>
            </table>
            <?php $form = ActiveForm::begin(['enableClientValidation' => false, 'enableAjaxValidation' => true, 'options' => ['class' => 'form-validate']]); ?>
            <tr>
                <th class="zx-goods-table"><?= $model->attributeLabels()['status']; ?></th>
                <td style="display: inline-block;width: 206px"><?= $form->field($model, 'status', ['template' => '{input}{error}{hint}'])->widget(\kartik\select2\Select2::className(),['data'=>['1'=>'通过',2=>'驳回'],'options' => ['placeholder' => '请选择']]) ?></td>
            </tr>
            <tr>
                <th class="zx-goods-table"><?= $model->attributeLabels()['auditing']; ?></th>
                <td><?= $form->field($model, 'auditing', ['template' => '{input}{error}{hint}'])->textarea(['rows' => '5']) ?></td>
            </tr>
        </table>
        <div class="zx-button-center">
            <?= Html::submitButton('提交', ['class' => "btn yx-next-step yx-radius5 button_step"]) ?>
        </div>
        <?php ActiveForm::end(); ?>
    </div>
</div>